// use crate::maths::{Mat4f, Vec3f};
use crate::matrix::{Mat4f, Vec3f};
// use cgmath::prelude::*;
// use cgmath::{point3, Matrix4, Point3, Vector3};
pub struct Camera {
    look_from: Vec3f,
    look_at: Vec3f,
    fovy: f32,
}
impl Default for Camera {
    fn default() -> Self {
        Self {
            look_from: Vec3f::from([0.0, 0.0, 1.0f32]),
            look_at: Vec3f::from([0.0, 0.0, 0.0f32]),
            fovy: 120.0_f32.to_radians(),
        }
    }
}
impl Camera {
    pub fn view_matrix(&self) -> Mat4f {
        Mat4f::view(
            self.look_from,
            self.look_at - self.look_from,
            Vec3f::unit_y(),
        )
    }
    pub fn half_fovy(&self) -> f32 {
        self.fovy / 2.0
    }
}
